跳到主要内容

start alist

#!/bin/bash

cd /opt/soft
wget https://github.com/alist-org/alist/releases/download/v3.29.1/alist-linux-musl-amd64.tar.gz
tar zxvf alist-linux-amd64.tar.gz
chmod +x alist

mkdir -p /opt/data/alist/local
mkdir -p /opt/data/alist/img


cat > /usr/lib/systemd/system/alist.service << EOF
[Unit]
Description=alist
After=network.target

[Service]
Type=simple
WorkingDirectory=/opt/soft
ExecStart=/opt/soft/alist server
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

systemctl start alist

systemctl enable alist

cat > /etc/nginx/conf.d/pan.arick.top.conf << EOF
server {
listen 80;

server_name pan.arick.top;

location / {
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto \$scheme;
proxy_set_header Host \$http_host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header Range \$http_range;
proxy_set_header If-Range \$http_if_range;
proxy_redirect off;

proxy_pass http://127.0.0.1:5244;
# the max size of file to upload
client_max_body_size 20000m;
}
}
EOF